using System;
using System.Collections.Generic;
using System.Text;
using SDMX_Common = SDMX_ML.Framework.Common;

namespace SDMX_ML.Framework.Structure
{
    public class KeyFamilyType
    {
        private ComponentsType _component;

        /// <summary>
        /// KeyFamily constructor with required fields.
        /// </summary>
        /// <param name="name">Name of KeyFamily.</param>
        /// <param name="id">ID of KeyFamily.</param>
        /// <param name="agencyID">Owner of KeyFamily.</param>
        public KeyFamilyType(string name, string id, string agencyID)
        {
            if (!String.IsNullOrEmpty(name) & !String.IsNullOrEmpty(id) & !String.IsNullOrEmpty(agencyID))
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                _name.Add(new SDMX_Common.TextType(name));
                _id = new SDMX_Common.IDType(id);
                _agencyid = new SDMX_Common.IDType(agencyID);
            }
            else
            {
                throw new Exception("Element name and attributes id and agencyID are requred in KeyFamilyType.");
            }
        }

        /// <summary>
        /// KeyFamily constructor with required fields.
        /// </summary>
        /// <param name="name">Name of KeyFamily.</param>
        /// <param name="id">ID of KeyFamily.</param>
        /// <param name="agencyID">Owner of KeyFamily.</param>
        public KeyFamilyType(SDMX_Common.TextType name, SDMX_Common.IDType id, SDMX_Common.IDType agencyID)
        {
            if (name != null & id != null & agencyID != null)
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                _name.Add(name);
                _id = id;
                _agencyid = agencyID;
            }
            else
            {
                throw new Exception("Element name and attributes id and agencyID are requred in KeyFamilyType.");
            }
        }

        /// <summary>
        /// KeyFamily constructor with required fields.
        /// </summary>
        /// <param name="name">Name of KeyFamily.</param>
        /// <param name="id">ID of KeyFamily.</param>
        /// <param name="agencyID">Owner of KeyFamily.</param>
        public KeyFamilyType(SDMX_Common.TextType name, string id, string agencyID)
        {
            if (name != null & !String.IsNullOrEmpty(id) & String.IsNullOrEmpty(agencyID))
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                _name.Add(name);
                _id = new SDMX_Common.IDType(id);
                _agencyid = new SDMX_Common.IDType(agencyID);
            }
            else
            {
                throw new Exception("Element name and attributes id and agencyID are requred in KeyFamilyType.");
            }
        }

        public ComponentsType Component
        {
            get { return _component; }
            set { _component = value; }
        }

        private List<SDMX_Common.TextType> _name;

        public List<SDMX_Common.TextType> Name
        {
            get { return _name; }
            set { _name = value; }
        }
        private List<SDMX_Common.TextType> _description;

        public List<SDMX_Common.TextType> Description
        {
            get { return _description; }
            set { _description = value; }
        }
        
        
        private SDMX_Common.IDType _id;

        public SDMX_Common.IDType ID
        {
            get { return _id; }
            set { _id = value; }
        }
        private SDMX_Common.IDType _agencyid;

        public SDMX_Common.IDType AgencyID
        {
            get { return _agencyid; }
            set { _agencyid = value; }
        }
        private string _version;

        public string Version
        {
            get { return _version; }
            set { _version = value; }
        }
        private string _uri;

        public string Uri
        {
            get { return _uri; }
            set { _uri = value; }
        }
        private string _urn;

        public string Urn
        {
            get { return _urn; }
            set { _urn = value; }
        }
        private bool? _isfinal;

        public bool? Isfinal
        {
            get { return _isfinal; }
            set { _isfinal = value; }
        }
        private bool? _isexternalreference;

        public bool? IsExternalReference
        {
            get { return _isexternalreference; }
            set { _isexternalreference = value; }
        }
        private string _validfrom;

        public string ValidFrom
        {
            get { return _validfrom; }
            set { _validfrom = value; }
        }
        private string _validto;

        public string ValidTo
        {
            get { return _validto; }
            set { _validto = value; }
        }

        private SDMX_Common.AnnotationsType _annotation;

        public SDMX_Common.AnnotationsType Annotations
        {
            get { return _annotation; }
            set { _annotation = value; }
        }


    }
}
